<?php

/**
 * Gets the e-mail of the specified contactId
 * @package ModuleOrganisationCommunication
 * @version 1.0b
 * @return contact e-mail address
 */

session_start();

// Configuration file
include '../configuration.php';
// Functions
include '../inc/functions.php';

// Checking if user is logged in
if (!CheckSession()):
	exit();
endif;

// Include all objects
// TODO: Include only needed classes
foreach (glob($configuration['webroot'].'objects/*.php') as $class) { include_once $class; }

$company = new Company();
$company->Get($_POST['id']);
$contact = $company->GetContact();
echo $contact->email;
?>